//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2021 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto/tree/main/CodeGenerator. DO NOT EDIT.

import Foundation
import SotoCore

extension LakeFormation {
    // MARK: Enums

    public enum ComparisonOperator: String, CustomStringConvertible, Codable {
        case beginsWith = "BEGINS_WITH"
        case between = "BETWEEN"
        case contains = "CONTAINS"
        case eq = "EQ"
        case ge = "GE"
        case gt = "GT"
        case `in` = "IN"
        case le = "LE"
        case lt = "LT"
        case ne = "NE"
        case notContains = "NOT_CONTAINS"
        public var description: String { return self.rawValue }
    }

    public enum DataLakeResourceType: String, CustomStringConvertible, Codable {
        case catalog = "CATALOG"
        case dataLocation = "DATA_LOCATION"
        case database = "DATABASE"
        case table = "TABLE"
        public var description: String { return self.rawValue }
    }

    public enum FieldNameString: String, CustomStringConvertible, Codable {
        case lastModified = "LAST_MODIFIED"
        case resourceArn = "RESOURCE_ARN"
        case roleArn = "ROLE_ARN"
        public var description: String { return self.rawValue }
    }

    public enum Permission: String, CustomStringConvertible, Codable {
        case all = "ALL"
        case alter = "ALTER"
        case createDatabase = "CREATE_DATABASE"
        case createTable = "CREATE_TABLE"
        case dataLocationAccess = "DATA_LOCATION_ACCESS"
        case delete = "DELETE"
        case describe = "DESCRIBE"
        case drop = "DROP"
        case insert = "INSERT"
        case select = "SELECT"
        public var description: String { return self.rawValue }
    }

    // MARK: Shapes

    public struct BatchGrantPermissionsRequest: AWSEncodableShape {
        /// The identifier for the Data Catalog. By default, the account ID. The Data Catalog is the persistent metadata store. It contains database definitions, table definitions, and other control information to manage your AWS Lake Formation environment.
        public let catalogId: String?
        /// A list of up to 20 entries for resource permissions to be granted by batch operation to the principal.
        public let entries: [BatchPermissionsRequestEntry]

        public init(catalogId: String? = nil, entries: [BatchPermissionsRequestEntry]) {
            self.catalogId = catalogId
            self.entries = entries
        }

        public func validate(name: String) throws {
            try self.validate(self.catalogId, name: "catalogId", parent: name, max: 255)
            try self.validate(self.catalogId, name: "catalogId", parent: name, min: 1)
            try self.validate(self.catalogId, name: "catalogId", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*")
            try self.entries.forEach {
                try $0.validate(name: "\(name).entries[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case catalogId = "CatalogId"
            case entries = "Entries"
        }
    }

    public struct BatchGrantPermissionsResponse: AWSDecodableShape {
        /// A list of failures to grant permissions to the resources.
        public let failures: [BatchPermissionsFailureEntry]?

        public init(failures: [BatchPermissionsFailureEntry]? = nil) {
            self.failures = failures
        }

        private enum CodingKeys: String, CodingKey {
            case failures = "Failures"
        }
    }

    public struct BatchPermissionsFailureEntry: AWSDecodableShape {
        /// An error message that applies to the failure of the entry.
        public let error: ErrorDetail?
        /// An identifier for an entry of the batch request.
        public let requestEntry: BatchPermissionsRequestEntry?

        public init(error: ErrorDetail? = nil, requestEntry: BatchPermissionsRequestEntry? = nil) {
            self.error = error
            self.requestEntry = requestEntry
        }

        private enum CodingKeys: String, CodingKey {
            case error = "Error"
            case requestEntry = "RequestEntry"
        }
    }

    public struct BatchPermissionsRequestEntry: AWSEncodableShape & AWSDecodableShape {
        /// A unique identifier for the batch permissions request entry.
        public let id: String
        /// The permissions to be granted.
        public let permissions: [Permission]?
        /// Indicates if the option to pass permissions is granted.
        public let permissionsWithGrantOption: [Permission]?
        /// The principal to be granted a permission.
        public let principal: DataLakePrincipal?
        /// The resource to which the principal is to be granted a permission.
        public let resource: Resource?

        public init(id: String, permissions: [Permission]? = nil, permissionsWithGrantOption: [Permission]? = nil, principal: DataLakePrincipal? = nil, resource: Resource? = nil) {
            self.id = id
            self.permissions = permissions
            self.permissionsWithGrantOption = permissionsWithGrantOption
            self.principal = principal
            self.resource = resource
        }

        public func validate(name: String) throws {
            try self.validate(self.id, name: "id", parent: name, max: 255)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.principal?.validate(name: "\(name).principal")
            try self.resource?.validate(name: "\(name).resource")
        }

        private enum CodingKeys: String, CodingKey {
            case id = "Id"
            case permissions = "Permissions"
            case permissionsWithGrantOption = "PermissionsWithGrantOption"
            case principal = "Principal"
            case resource = "Resource"
        }
    }

    public struct BatchRevokePermissionsRequest: AWSEncodableShape {
        /// The identifier for the Data Catalog. By default, the account ID. The Data Catalog is the persistent metadata store. It contains database definitions, table definitions, and other control information to manage your AWS Lake Formation environment.
        public let catalogId: String?
        /// A list of up to 20 entries for resource permissions to be revoked by batch operation to the principal.
        public let entries: [BatchPermissionsRequestEntry]

        public init(catalogId: String? = nil, entries: [BatchPermissionsRequestEntry]) {
            self.catalogId = catalogId
            self.entries = entries
        }

        public func validate(name: String) throws {
            try self.validate(self.catalogId, name: "catalogId", parent: name, max: 255)
            try self.validate(self.catalogId, name: "catalogId", parent: name, min: 1)
            try self.validate(self.catalogId, name: "catalogId", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*")
            try self.entries.forEach {
                try $0.validate(name: "\(name).entries[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case catalogId = "CatalogId"
            case entries = "Entries"
        }
    }

    public struct BatchRevokePermissionsResponse: AWSDecodableShape {
        /// A list of failures to revoke permissions to the resources.
        public let failures: [BatchPermissionsFailureEntry]?

        public init(failures: [BatchPermissionsFailureEntry]? = nil) {
            self.failures = failures
        }

        private enum CodingKeys: String, CodingKey {
            case failures = "Failures"
        }
    }

    public struct CatalogResource: AWSEncodableShape & AWSDecodableShape {
        public init() {}
    }

    public struct ColumnWildcard: AWSEncodableShape & AWSDecodableShape {
        /// Excludes column names. Any column with this name will be excluded.
        public let excludedColumnNames: [String]?

        public init(excludedColumnNames: [String]? = nil) {
            self.excludedColumnNames = excludedColumnNames
        }

        public func validate(name: String) throws {
            try self.excludedColumnNames?.forEach {
                try validate($0, name: "excludedColumnNames[]", parent: name, max: 255)
                try validate($0, name: "excludedColumnNames[]", parent: name, min: 1)
                try validate($0, name: "excludedColumnNames[]", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case excludedColumnNames = "ExcludedColumnNames"
        }
    }

    public struct DataLakePrincipal: AWSEncodableShape & AWSDecodableShape {
        /// An identifier for the AWS Lake Formation principal.
        public let dataLakePrincipalIdentifier: String?

        public init(dataLakePrincipalIdentifier: String? = nil) {
            self.dataLakePrincipalIdentifier = dataLakePrincipalIdentifier
        }

        public func validate(name: String) throws {
            try self.validate(self.dataLakePrincipalIdentifier, name: "dataLakePrincipalIdentifier", parent: name, max: 255)
            try self.validate(self.dataLakePrincipalIdentifier, name: "dataLakePrincipalIdentifier", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case dataLakePrincipalIdentifier = "DataLakePrincipalIdentifier"
        }
    }

    public struct DataLakeSettings: AWSEncodableShape & AWSDecodableShape {
        /// A structure representing a list of up to three principal permissions entries for default create database permissions.
        public let createDatabaseDefaultPermissions: [PrincipalPermissions]?
        /// A structure representing a list of up to three principal permissions entries for default create table permissions.
        public let createTableDefaultPermissions: [PrincipalPermissions]?
        /// A list of AWS Lake Formation principals. Supported principals are IAM users or IAM roles.
        public let dataLakeAdmins: [DataLakePrincipal]?
        /// A list of the resource-owning account IDs that the caller's account can use to share their user access details (user ARNs). The user ARNs can be logged in the resource owner's AWS CloudTrail log. You may want to specify this property when you are in a high-trust boundary, such as the same team or company.
        public let trustedResourceOwners: [String]?

        public init(createDatabaseDefaultPermissions: [PrincipalPermissions]? = nil, createTableDefaultPermissions: [PrincipalPermissions]? = nil, dataLakeAdmins: [DataLakePrincipal]? = nil, trustedResourceOwners: [String]? = nil) {
            self.createDatabaseDefaultPermissions = createDatabaseDefaultPermissions
            self.createTableDefaultPermissions = createTableDefaultPermissions
            self.dataLakeAdmins = dataLakeAdmins
            self.trustedResourceOwners = trustedResourceOwners
        }

        public func validate(name: String) throws {
            try self.createDatabaseDefaultPermissions?.forEach {
                try $0.validate(name: "\(name).createDatabaseDefaultPermissions[]")
            }
            try self.createTableDefaultPermissions?.forEach {
                try $0.validate(name: "\(name).createTableDefaultPermissions[]")
            }
            try self.dataLakeAdmins?.forEach {
                try $0.validate(name: "\(name).dataLakeAdmins[]")
            }
            try self.validate(self.dataLakeAdmins, name: "dataLakeAdmins", parent: name, max: 10)
            try self.validate(self.dataLakeAdmins, name: "dataLakeAdmins", parent: name, min: 0)
            try self.trustedResourceOwners?.forEach {
                try validate($0, name: "trustedResourceOwners[]", parent: name, max: 255)
                try validate($0, name: "trustedResourceOwners[]", parent: name, min: 1)
                try validate($0, name: "trustedResourceOwners[]", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case createDatabaseDefaultPermissions = "CreateDatabaseDefaultPermissions"
            case createTableDefaultPermissions = "CreateTableDefaultPermissions"
            case dataLakeAdmins = "DataLakeAdmins"
            case trustedResourceOwners = "TrustedResourceOwners"
        }
    }

    public struct DataLocationResource: AWSEncodableShape & AWSDecodableShape {
        /// The identifier for the Data Catalog where the location is registered with AWS Lake Formation. By default, it is the account ID of the caller.
        public let catalogId: String?
        /// The Amazon Resource Name (ARN) that uniquely identifies the data location resource.
        public let resourceArn: String

        public init(catalogId: String? = nil, resourceArn: String) {
            self.catalogId = catalogId
            self.resourceArn = resourceArn
        }

        public func validate(name: String) throws {
            try self.validate(self.catalogId, name: "catalogId", parent: name, max: 255)
            try self.validate(self.catalogId, name: "catalogId", parent: name, min: 1)
            try self.validate(self.catalogId, name: "catalogId", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case catalogId = "CatalogId"
            case resourceArn = "ResourceArn"
        }
    }

    public struct DatabaseResource: AWSEncodableShape & AWSDecodableShape {
        /// The identifier for the Data Catalog. By default, it is the account ID of the caller.
        public let catalogId: String?
        /// The name of the database resource. Unique to the Data Catalog.
        public let name: String

        public init(catalogId: String? = nil, name: String) {
            self.catalogId = catalogId
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.catalogId, name: "catalogId", parent: name, max: 255)
            try self.validate(self.catalogId, name: "catalogId", parent: name, min: 1)
            try self.validate(self.catalogId, name: "catalogId", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*")
            try self.validate(self.name, name: "name", parent: name, max: 255)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case catalogId = "CatalogId"
            case name = "Name"
        }
    }

    public struct DeregisterResourceRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the resource that you want to deregister.
        public let resourceArn: String

        public init(resourceArn: String) {
            self.resourceArn = resourceArn
        }

        private enum CodingKeys: String, CodingKey {
            case resourceArn = "ResourceArn"
        }
    }

    public struct DeregisterResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DescribeResourceRequest: AWSEncodableShape {
        /// The resource ARN.
        public let resourceArn: String

        public init(resourceArn: String) {
            self.resourceArn = resourceArn
        }

        private enum CodingKeys: String, CodingKey {
            case resourceArn = "ResourceArn"
        }
    }

    public struct DescribeResourceResponse: AWSDecodableShape {
        /// A structure containing information about an AWS Lake Formation resource.
        public let resourceInfo: ResourceInfo?

        public init(resourceInfo: ResourceInfo? = nil) {
            self.resourceInfo = resourceInfo
        }

        private enum CodingKeys: String, CodingKey {
            case resourceInfo = "ResourceInfo"
        }
    }

    public struct DetailsMap: AWSDecodableShape {
        /// A share resource ARN for a catalog resource shared through AWS Resource Access Manager (AWS RAM).
        public let resourceShare: [String]?

        public init(resourceShare: [String]? = nil) {
            self.resourceShare = resourceShare
        }

        private enum CodingKeys: String, CodingKey {
            case resourceShare = "ResourceShare"
        }
    }

    public struct ErrorDetail: AWSDecodableShape {
        /// The code associated with this error.
        public let errorCode: String?
        /// A message describing the error.
        public let errorMessage: String?

        public init(errorCode: String? = nil, errorMessage: String? = nil) {
            self.errorCode = errorCode
            self.errorMessage = errorMessage
        }

        private enum CodingKeys: String, CodingKey {
            case errorCode = "ErrorCode"
            case errorMessage = "ErrorMessage"
        }
    }

    public struct FilterCondition: AWSEncodableShape {
        /// The comparison operator used in the filter condition.
        public let comparisonOperator: ComparisonOperator?
        /// The field to filter in the filter condition.
        public let field: FieldNameString?
        /// A string with values used in evaluating the filter condition.
        public let stringValueList: [String]?

        public init(comparisonOperator: ComparisonOperator? = nil, field: FieldNameString? = nil, stringValueList: [String]? = nil) {
            self.comparisonOperator = comparisonOperator
            self.field = field
            self.stringValueList = stringValueList
        }

        private enum CodingKeys: String, CodingKey {
            case comparisonOperator = "ComparisonOperator"
            case field = "Field"
            case stringValueList = "StringValueList"
        }
    }

    public struct GetDataLakeSettingsRequest: AWSEncodableShape {
        /// The identifier for the Data Catalog. By default, the account ID. The Data Catalog is the persistent metadata store. It contains database definitions, table definitions, and other control information to manage your AWS Lake Formation environment.
        public let catalogId: String?

        public init(catalogId: String? = nil) {
            self.catalogId = catalogId
        }

        public func validate(name: String) throws {
            try self.validate(self.catalogId, name: "catalogId", parent: name, max: 255)
            try self.validate(self.catalogId, name: "catalogId", parent: name, min: 1)
            try self.validate(self.catalogId, name: "catalogId", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case catalogId = "CatalogId"
        }
    }

    public struct GetDataLakeSettingsResponse: AWSDecodableShape {
        /// A structure representing a list of AWS Lake Formation principals designated as data lake administrators.
        public let dataLakeSettings: DataLakeSettings?

        public init(dataLakeSettings: DataLakeSettings? = nil) {
            self.dataLakeSettings = dataLakeSettings
        }

        private enum CodingKeys: String, CodingKey {
            case dataLakeSettings = "DataLakeSettings"
        }
    }

    public struct GetEffectivePermissionsForPathRequest: AWSEncodableShape {
        /// The identifier for the Data Catalog. By default, the account ID. The Data Catalog is the persistent metadata store. It contains database definitions, table definitions, and other control information to manage your AWS Lake Formation environment.
        public let catalogId: String?
        /// The maximum number of results to return.
        public let maxResults: Int?
        /// A continuation token, if this is not the first call to retrieve this list.
        public let nextToken: String?
        /// The Amazon Resource Name (ARN) of the resource for which you want to get permissions.
        public let resourceArn: String

        public init(catalogId: String? = nil, maxResults: Int? = nil, nextToken: String? = nil, resourceArn: String) {
            self.catalogId = catalogId
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.resourceArn = resourceArn
        }

        public func validate(name: String) throws {
            try self.validate(self.catalogId, name: "catalogId", parent: name, max: 255)
            try self.validate(self.catalogId, name: "catalogId", parent: name, min: 1)
            try self.validate(self.catalogId, name: "catalogId", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 1000)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case catalogId = "CatalogId"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case resourceArn = "ResourceArn"
        }
    }

    public struct GetEffectivePermissionsForPathResponse: AWSDecodableShape {
        /// A continuation token, if this is not the first call to retrieve this list.
        public let nextToken: String?
        /// A list of the permissions for the specified table or database resource located at the path in Amazon S3.
        public let permissions: [PrincipalResourcePermissions]?

        public init(nextToken: String? = nil, permissions: [PrincipalResourcePermissions]? = nil) {
            self.nextToken = nextToken
            self.permissions = permissions
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case permissions = "Permissions"
        }
    }

    public struct GrantPermissionsRequest: AWSEncodableShape {
        /// The identifier for the Data Catalog. By default, the account ID. The Data Catalog is the persistent metadata store. It contains database definitions, table definitions, and other control information to manage your AWS Lake Formation environment.
        public let catalogId: String?
        /// The permissions granted to the principal on the resource. AWS Lake Formation defines privileges to grant and revoke access to metadata in the Data Catalog and data organized in underlying data storage such as Amazon S3. AWS Lake Formation requires that each principal be authorized to perform a specific task on AWS Lake Formation resources.
        public let permissions: [Permission]
        /// Indicates a list of the granted permissions that the principal may pass to other users. These permissions may only be a subset of the permissions granted in the Privileges.
        public let permissionsWithGrantOption: [Permission]?
        /// The principal to be granted the permissions on the resource. Supported principals are IAM users or IAM roles, and they are defined by their principal type and their ARN. Note that if you define a resource with a particular ARN, then later delete, and recreate a resource with that same ARN, the resource maintains the permissions already granted.
        public let principal: DataLakePrincipal
        /// The resource to which permissions are to be granted. Resources in AWS Lake Formation are the Data Catalog, databases, and tables.
        public let resource: Resource

        public init(catalogId: String? = nil, permissions: [Permission], permissionsWithGrantOption: [Permission]? = nil, principal: DataLakePrincipal, resource: Resource) {
            self.catalogId = catalogId
            self.permissions = permissions
            self.permissionsWithGrantOption = permissionsWithGrantOption
            self.principal = principal
            self.resource = resource
        }

        public func validate(name: String) throws {
            try self.validate(self.catalogId, name: "catalogId", parent: name, max: 255)
            try self.validate(self.catalogId, name: "catalogId", parent: name, min: 1)
            try self.validate(self.catalogId, name: "catalogId", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*")
            try self.principal.validate(name: "\(name).principal")
            try self.resource.validate(name: "\(name).resource")
        }

        private enum CodingKeys: String, CodingKey {
            case catalogId = "CatalogId"
            case permissions = "Permissions"
            case permissionsWithGrantOption = "PermissionsWithGrantOption"
            case principal = "Principal"
            case resource = "Resource"
        }
    }

    public struct GrantPermissionsResponse: AWSDecodableShape {
        public init() {}
    }

    public struct ListPermissionsRequest: AWSEncodableShape {
        /// The identifier for the Data Catalog. By default, the account ID. The Data Catalog is the persistent metadata store. It contains database definitions, table definitions, and other control information to manage your AWS Lake Formation environment.
        public let catalogId: String?
        /// The maximum number of results to return.
        public let maxResults: Int?
        /// A continuation token, if this is not the first call to retrieve this list.
        public let nextToken: String?
        /// Specifies a principal to filter the permissions returned.
        public let principal: DataLakePrincipal?
        /// A resource where you will get a list of the principal permissions. This operation does not support getting privileges on a table with columns. Instead, call this operation on the table, and the operation returns the table and the table w columns.
        public let resource: Resource?
        /// Specifies a resource type to filter the permissions returned.
        public let resourceType: DataLakeResourceType?

        public init(catalogId: String? = nil, maxResults: Int? = nil, nextToken: String? = nil, principal: DataLakePrincipal? = nil, resource: Resource? = nil, resourceType: DataLakeResourceType? = nil) {
            self.catalogId = catalogId
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.principal = principal
            self.resource = resource
            self.resourceType = resourceType
        }

        public func validate(name: String) throws {
            try self.validate(self.catalogId, name: "catalogId", parent: name, max: 255)
            try self.validate(self.catalogId, name: "catalogId", parent: name, min: 1)
            try self.validate(self.catalogId, name: "catalogId", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 1000)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.principal?.validate(name: "\(name).principal")
            try self.resource?.validate(name: "\(name).resource")
        }

        private enum CodingKeys: String, CodingKey {
            case catalogId = "CatalogId"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case principal = "Principal"
            case resource = "Resource"
            case resourceType = "ResourceType"
        }
    }

    public struct ListPermissionsResponse: AWSDecodableShape {
        /// A continuation token, if this is not the first call to retrieve this list.
        public let nextToken: String?
        /// A list of principals and their permissions on the resource for the specified principal and resource types.
        public let principalResourcePermissions: [PrincipalResourcePermissions]?

        public init(nextToken: String? = nil, principalResourcePermissions: [PrincipalResourcePermissions]? = nil) {
            self.nextToken = nextToken
            self.principalResourcePermissions = principalResourcePermissions
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case principalResourcePermissions = "PrincipalResourcePermissions"
        }
    }

    public struct ListResourcesRequest: AWSEncodableShape {
        /// Any applicable row-level and/or column-level filtering conditions for the resources.
        public let filterConditionList: [FilterCondition]?
        /// The maximum number of resource results.
        public let maxResults: Int?
        /// A continuation token, if this is not the first call to retrieve these resources.
        public let nextToken: String?

        public init(filterConditionList: [FilterCondition]? = nil, maxResults: Int? = nil, nextToken: String? = nil) {
            self.filterConditionList = filterConditionList
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.filterConditionList, name: "filterConditionList", parent: name, max: 20)
            try self.validate(self.filterConditionList, name: "filterConditionList", parent: name, min: 1)
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 1000)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case filterConditionList = "FilterConditionList"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListResourcesResponse: AWSDecodableShape {
        /// A continuation token, if this is not the first call to retrieve these resources.
        public let nextToken: String?
        /// A summary of the data lake resources.
        public let resourceInfoList: [ResourceInfo]?

        public init(nextToken: String? = nil, resourceInfoList: [ResourceInfo]? = nil) {
            self.nextToken = nextToken
            self.resourceInfoList = resourceInfoList
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case resourceInfoList = "ResourceInfoList"
        }
    }

    public struct PrincipalPermissions: AWSEncodableShape & AWSDecodableShape {
        /// The permissions that are granted to the principal.
        public let permissions: [Permission]?
        /// The principal who is granted permissions.
        public let principal: DataLakePrincipal?

        public init(permissions: [Permission]? = nil, principal: DataLakePrincipal? = nil) {
            self.permissions = permissions
            self.principal = principal
        }

        public func validate(name: String) throws {
            try self.principal?.validate(name: "\(name).principal")
        }

        private enum CodingKeys: String, CodingKey {
            case permissions = "Permissions"
            case principal = "Principal"
        }
    }

    public struct PrincipalResourcePermissions: AWSDecodableShape {
        /// This attribute can be used to return any additional details of PrincipalResourcePermissions. Currently returns only as a RAM share resource ARN.
        public let additionalDetails: DetailsMap?
        /// The permissions to be granted or revoked on the resource.
        public let permissions: [Permission]?
        /// Indicates whether to grant the ability to grant permissions (as a subset of permissions granted).
        public let permissionsWithGrantOption: [Permission]?
        /// The Data Lake principal to be granted or revoked permissions.
        public let principal: DataLakePrincipal?
        /// The resource where permissions are to be granted or revoked.
        public let resource: Resource?

        public init(additionalDetails: DetailsMap? = nil, permissions: [Permission]? = nil, permissionsWithGrantOption: [Permission]? = nil, principal: DataLakePrincipal? = nil, resource: Resource? = nil) {
            self.additionalDetails = additionalDetails
            self.permissions = permissions
            self.permissionsWithGrantOption = permissionsWithGrantOption
            self.principal = principal
            self.resource = resource
        }

        private enum CodingKeys: String, CodingKey {
            case additionalDetails = "AdditionalDetails"
            case permissions = "Permissions"
            case permissionsWithGrantOption = "PermissionsWithGrantOption"
            case principal = "Principal"
            case resource = "Resource"
        }
    }

    public struct PutDataLakeSettingsRequest: AWSEncodableShape {
        /// The identifier for the Data Catalog. By default, the account ID. The Data Catalog is the persistent metadata store. It contains database definitions, table definitions, and other control information to manage your AWS Lake Formation environment.
        public let catalogId: String?
        /// A structure representing a list of AWS Lake Formation principals designated as data lake administrators.
        public let dataLakeSettings: DataLakeSettings

        public init(catalogId: String? = nil, dataLakeSettings: DataLakeSettings) {
            self.catalogId = catalogId
            self.dataLakeSettings = dataLakeSettings
        }

        public func validate(name: String) throws {
            try self.validate(self.catalogId, name: "catalogId", parent: name, max: 255)
            try self.validate(self.catalogId, name: "catalogId", parent: name, min: 1)
            try self.validate(self.catalogId, name: "catalogId", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*")
            try self.dataLakeSettings.validate(name: "\(name).dataLakeSettings")
        }

        private enum CodingKeys: String, CodingKey {
            case catalogId = "CatalogId"
            case dataLakeSettings = "DataLakeSettings"
        }
    }

    public struct PutDataLakeSettingsResponse: AWSDecodableShape {
        public init() {}
    }

    public struct RegisterResourceRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the resource that you want to register.
        public let resourceArn: String
        /// The identifier for the role that registers the resource.
        public let roleArn: String?
        /// Designates an AWS Identity and Access Management (IAM) service-linked role by registering this role with the Data Catalog. A service-linked role is a unique type of IAM role that is linked directly to Lake Formation. For more information, see Using Service-Linked Roles for Lake Formation.
        public let useServiceLinkedRole: Bool?

        public init(resourceArn: String, roleArn: String? = nil, useServiceLinkedRole: Bool? = nil) {
            self.resourceArn = resourceArn
            self.roleArn = roleArn
            self.useServiceLinkedRole = useServiceLinkedRole
        }

        public func validate(name: String) throws {
            try self.validate(self.roleArn, name: "roleArn", parent: name, pattern: "arn:aws:iam::[0-9]*:role/.*")
        }

        private enum CodingKeys: String, CodingKey {
            case resourceArn = "ResourceArn"
            case roleArn = "RoleArn"
            case useServiceLinkedRole = "UseServiceLinkedRole"
        }
    }

    public struct RegisterResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct Resource: AWSEncodableShape & AWSDecodableShape {
        /// The identifier for the Data Catalog. By default, the account ID. The Data Catalog is the persistent metadata store. It contains database definitions, table definitions, and other control information to manage your AWS Lake Formation environment.
        public let catalog: CatalogResource?
        /// The database for the resource. Unique to the Data Catalog. A database is a set of associated table definitions organized into a logical group. You can Grant and Revoke database permissions to a principal.
        public let database: DatabaseResource?
        /// The location of an Amazon S3 path where permissions are granted or revoked.
        public let dataLocation: DataLocationResource?
        /// The table for the resource. A table is a metadata definition that represents your data. You can Grant and Revoke table privileges to a principal.
        public let table: TableResource?
        /// The table with columns for the resource. A principal with permissions to this resource can select metadata from the columns of a table in the Data Catalog and the underlying data in Amazon S3.
        public let tableWithColumns: TableWithColumnsResource?

        public init(catalog: CatalogResource? = nil, database: DatabaseResource? = nil, dataLocation: DataLocationResource? = nil, table: TableResource? = nil, tableWithColumns: TableWithColumnsResource? = nil) {
            self.catalog = catalog
            self.database = database
            self.dataLocation = dataLocation
            self.table = table
            self.tableWithColumns = tableWithColumns
        }

        public func validate(name: String) throws {
            try self.database?.validate(name: "\(name).database")
            try self.dataLocation?.validate(name: "\(name).dataLocation")
            try self.table?.validate(name: "\(name).table")
            try self.tableWithColumns?.validate(name: "\(name).tableWithColumns")
        }

        private enum CodingKeys: String, CodingKey {
            case catalog = "Catalog"
            case database = "Database"
            case dataLocation = "DataLocation"
            case table = "Table"
            case tableWithColumns = "TableWithColumns"
        }
    }

    public struct ResourceInfo: AWSDecodableShape {
        /// The date and time the resource was last modified.
        public let lastModified: Date?
        /// The Amazon Resource Name (ARN) of the resource.
        public let resourceArn: String?
        /// The IAM role that registered a resource.
        public let roleArn: String?

        public init(lastModified: Date? = nil, resourceArn: String? = nil, roleArn: String? = nil) {
            self.lastModified = lastModified
            self.resourceArn = resourceArn
            self.roleArn = roleArn
        }

        private enum CodingKeys: String, CodingKey {
            case lastModified = "LastModified"
            case resourceArn = "ResourceArn"
            case roleArn = "RoleArn"
        }
    }

    public struct RevokePermissionsRequest: AWSEncodableShape {
        /// The identifier for the Data Catalog. By default, the account ID. The Data Catalog is the persistent metadata store. It contains database definitions, table definitions, and other control information to manage your AWS Lake Formation environment.
        public let catalogId: String?
        /// The permissions revoked to the principal on the resource. For information about permissions, see Security and Access Control to Metadata and Data.
        public let permissions: [Permission]
        /// Indicates a list of permissions for which to revoke the grant option allowing the principal to pass permissions to other principals.
        public let permissionsWithGrantOption: [Permission]?
        /// The principal to be revoked permissions on the resource.
        public let principal: DataLakePrincipal
        /// The resource to which permissions are to be revoked.
        public let resource: Resource

        public init(catalogId: String? = nil, permissions: [Permission], permissionsWithGrantOption: [Permission]? = nil, principal: DataLakePrincipal, resource: Resource) {
            self.catalogId = catalogId
            self.permissions = permissions
            self.permissionsWithGrantOption = permissionsWithGrantOption
            self.principal = principal
            self.resource = resource
        }

        public func validate(name: String) throws {
            try self.validate(self.catalogId, name: "catalogId", parent: name, max: 255)
            try self.validate(self.catalogId, name: "catalogId", parent: name, min: 1)
            try self.validate(self.catalogId, name: "catalogId", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*")
            try self.principal.validate(name: "\(name).principal")
            try self.resource.validate(name: "\(name).resource")
        }

        private enum CodingKeys: String, CodingKey {
            case catalogId = "CatalogId"
            case permissions = "Permissions"
            case permissionsWithGrantOption = "PermissionsWithGrantOption"
            case principal = "Principal"
            case resource = "Resource"
        }
    }

    public struct RevokePermissionsResponse: AWSDecodableShape {
        public init() {}
    }

    public struct TableResource: AWSEncodableShape & AWSDecodableShape {
        /// The identifier for the Data Catalog. By default, it is the account ID of the caller.
        public let catalogId: String?
        /// The name of the database for the table. Unique to a Data Catalog. A database is a set of associated table definitions organized into a logical group. You can Grant and Revoke database privileges to a principal.
        public let databaseName: String
        /// The name of the table.
        public let name: String?
        /// A wildcard object representing every table under a database. At least one of TableResource$Name or TableResource$TableWildcard is required.
        public let tableWildcard: TableWildcard?

        public init(catalogId: String? = nil, databaseName: String, name: String? = nil, tableWildcard: TableWildcard? = nil) {
            self.catalogId = catalogId
            self.databaseName = databaseName
            self.name = name
            self.tableWildcard = tableWildcard
        }

        public func validate(name: String) throws {
            try self.validate(self.catalogId, name: "catalogId", parent: name, max: 255)
            try self.validate(self.catalogId, name: "catalogId", parent: name, min: 1)
            try self.validate(self.catalogId, name: "catalogId", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*")
            try self.validate(self.databaseName, name: "databaseName", parent: name, max: 255)
            try self.validate(self.databaseName, name: "databaseName", parent: name, min: 1)
            try self.validate(self.databaseName, name: "databaseName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*")
            try self.validate(self.name, name: "name", parent: name, max: 255)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case catalogId = "CatalogId"
            case databaseName = "DatabaseName"
            case name = "Name"
            case tableWildcard = "TableWildcard"
        }
    }

    public struct TableWildcard: AWSEncodableShape & AWSDecodableShape {
        public init() {}
    }

    public struct TableWithColumnsResource: AWSEncodableShape & AWSDecodableShape {
        /// The identifier for the Data Catalog. By default, it is the account ID of the caller.
        public let catalogId: String?
        /// The list of column names for the table. At least one of ColumnNames or ColumnWildcard is required.
        public let columnNames: [String]?
        /// A wildcard specified by a ColumnWildcard object. At least one of ColumnNames or ColumnWildcard is required.
        public let columnWildcard: ColumnWildcard?
        /// The name of the database for the table with columns resource. Unique to the Data Catalog. A database is a set of associated table definitions organized into a logical group. You can Grant and Revoke database privileges to a principal.
        public let databaseName: String
        /// The name of the table resource. A table is a metadata definition that represents your data. You can Grant and Revoke table privileges to a principal.
        public let name: String

        public init(catalogId: String? = nil, columnNames: [String]? = nil, columnWildcard: ColumnWildcard? = nil, databaseName: String, name: String) {
            self.catalogId = catalogId
            self.columnNames = columnNames
            self.columnWildcard = columnWildcard
            self.databaseName = databaseName
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.catalogId, name: "catalogId", parent: name, max: 255)
            try self.validate(self.catalogId, name: "catalogId", parent: name, min: 1)
            try self.validate(self.catalogId, name: "catalogId", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*")
            try self.columnNames?.forEach {
                try validate($0, name: "columnNames[]", parent: name, max: 255)
                try validate($0, name: "columnNames[]", parent: name, min: 1)
                try validate($0, name: "columnNames[]", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*")
            }
            try self.columnWildcard?.validate(name: "\(name).columnWildcard")
            try self.validate(self.databaseName, name: "databaseName", parent: name, max: 255)
            try self.validate(self.databaseName, name: "databaseName", parent: name, min: 1)
            try self.validate(self.databaseName, name: "databaseName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*")
            try self.validate(self.name, name: "name", parent: name, max: 255)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case catalogId = "CatalogId"
            case columnNames = "ColumnNames"
            case columnWildcard = "ColumnWildcard"
            case databaseName = "DatabaseName"
            case name = "Name"
        }
    }

    public struct UpdateResourceRequest: AWSEncodableShape {
        /// The resource ARN.
        public let resourceArn: String
        /// The new role to use for the given resource registered in AWS Lake Formation.
        public let roleArn: String

        public init(resourceArn: String, roleArn: String) {
            self.resourceArn = resourceArn
            self.roleArn = roleArn
        }

        public func validate(name: String) throws {
            try self.validate(self.roleArn, name: "roleArn", parent: name, pattern: "arn:aws:iam::[0-9]*:role/.*")
        }

        private enum CodingKeys: String, CodingKey {
            case resourceArn = "ResourceArn"
            case roleArn = "RoleArn"
        }
    }

    public struct UpdateResourceResponse: AWSDecodableShape {
        public init() {}
    }
}
